using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using DotNetCommon.Expressions.Base;
using DotNetCommon.Extensions;

namespace DotNetCommon.Expressions.Visit
{
    /// <summary>
    /// 参数
    /// </summary>
    internal class ParameterVisit : BaseVisit
    {
        protected override void Prepare(ExpressionNode node)
        {
            var parameter = node.Expression as ParameterExpression;
            if (node.Parameters.Contains(node.Expression))
                node.IsParameter = true;
        }

        protected override string GenerateFullMarkString(ExpressionNode node)
        {
            var parameter = node.Expression as ParameterExpression;
            return $"{parameter.Name}";
        }
    }
}
